cmake_minimum_required(VERSION 2.6)
project(jamus)

set(binDirectory bin)
set(pluginDirectory lib/jamus/plugins)

enable_testing()

if(NOT CMAKE_BUILD_TYPE)
	set(CMAKE_BUILD_TYPE Debug)
	set(PLUGIN_DIRECTORY ".")
else(NOT CMAKE_BUILD_TYPE)
	set(PLUGIN_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${pluginDirectory}")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_FLAGS "-Wall -pedantic -ansi")

include(CPack)

#INCLUDE(TestForSTDNameSpace)
set(Boost_USE_MULTITHREADED ON)
include(FindLog4Cxx.cmake)
find_package (Boost 1.41.0 COMPONENTS thread system regex unit_test_framework)
if(LOG4CXX_FOUND)
	include_directories(${LOG4CXX_INCLUDE_DIR})
else(LOG4CXX_FOUND)
	message(FATAL_ERROR "Log4CXX not found")
endif()

find_package(Qt4 4.4.0 COMPONENTS QtCore QtDBus)

if(QT_QTDBUS_FOUND)
	set(BUILD_AMAROK_PLUGIN YES)
	set(QTDBUS_LIB "-lQtCore -lQtDBus")
	message(STATUS "QtDBus>=4.4.0 found, amarok plugins activated")
	add_definitions(-DQtWorkaround)
else(QT_QTDBUS_FOUND)
	set(BUILD_AMAROK_PLUGIN NO)
	set(QTDBUS_LIB "")
	message(STATUS "QtDBus>=4.4.0 not found, amarok plugins deactivated")
endif()

if(Boost_FOUND)
	include_directories(${Boost_INCLUDE_DIRS})
	add_subdirectory (src)
else(Boost_FOUND)
message(FATAL_ERROR "Boost(>=1.41.0) not found")
endif()
